<template>
  <div class="container">
    <div class="head">
      <div class="bg"></div>
      <img class="userpic" src="@/assets/images/3.jpg">
      <div class="username">赤子之心</div>
      <div class="info flex-row">
        <div class="flex-grow-1 flex-x-center">我的帖子 <span class="moneyColor">1</span></div>
        <div class="line"></div>
        <div class="flex-grow-1 flex-x-center">关注 <span class="moneyColor">1</span></div>
        <div class="line"></div>
        <div class="flex-grow-1 flex-x-center">被赞 <span class="moneyColor">1</span></div>
      </div>
    </div>
    <div class="waterfall">
      <div class="item">
        <div class="item-content edit">
          <img class="userpic" src="@/assets/images/icon-red/edit.png">
          <div class="content moneyColor">写心得</div>
        </div>
      </div>
      <div class="item" v-for="item,index in list" :key="index">
        <div class="item-content">
          <img class="userpic" src="@/assets/images/3.jpg">
          <div class="title">{{item.title}}</div>
          <div class="content">{{item.content}}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default ({
  data() {
    return {
      list: [{
          "title": "早安",
          "img": "/images/2.jpg",
          "content": "我用岁月做筏"
        },
        {
          "title": "早安",
          "img": "/images/3.jpg",
          "content": "我用岁月做筏，将初遇的我用岁月做筏，将初遇的我用岁月做筏，将初遇的我用岁月做筏，将初遇的"
        },
        {
          "title": "早安",
          "img": "/images/qunzi.jpg",
          "content": "我用岁月做筏，"
        },
        {
          "title": "早安",
          "img": "/images/img/1.jpg",
          "content": "我用岁月做筏，将初遇的我用岁月做筏，将初遇的我用岁月做筏，将初遇的我用岁月做筏，将初遇的"
        },
        {
          "title": "早安",
          "img": "/images/img/pinggou.png",
          "content": "我用岁月做筏"
        },
      ]
    }
  }
})

</script>
<style scoped lang="less">
.head {
  position: relative;
  height: 12rem;
  width: 100%;
  background-color: #fff;
  .userpic {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 4rem;
    width: 4rem;
    margin-top: -2rem;
    margin-left: -2rem;
    border-radius: 50%;
  }
  .bg {
    height: 50%;
    background-color: #FFABD7;
  }
  .username {
    margin-top: 2.2rem;
    font-size: .8rem;
    text-align: center;
  }
  .info {
    margin-top: .5rem;
    font-size: .7rem;
    span{
    	margin-left:.3rem;
    }
    .line {
      height: 1rem;
      width: 1px;
      background-color: #ddd;
    }
  }
}

.waterfall {
  column-count: 2;
  column-gap: 0;
}

.item {
  box-sizing: border-box;
  break-inside: avoid;
  padding: .2rem;
}

.item-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px;
  height: auto;
  font-size: 20px;
  color: #686868;
  box-sizing: border-box;
  background-color: #fff;
  .title {
    font-size: .8rem;
    color: #000;
    padding: .3rem 0;
  }
  .content {
    font-size: .6rem;
  }
  img {
    width: 100%;
  }
}
.edit {
  align-items: center;
  padding:2rem 0;
  img{
    height:1.5rem;
    width:1.5rem;
 }
}

</style>
